﻿@model List<Smarly.Bussines.Model.BookTree>

@if (Model == null)
{
	return;
}

@foreach (var chapter in Model)
{
	if (Model.SelectMany(x => x.Children).Any())
	{
		<dt>
			<a href="@chapter.Url" class="@(chapter.Published ? "bgg" : "bgr")">@chapter.Text</a>
		</dt>
		@Html.Partial("_BookContentPartial", chapter.Children)
	}
	else
	{
		<dd>
			<a href="@chapter.Url" class="@(chapter.Published ? "bgg" : "bgr")">@chapter.Text</a>
		</dd>
	}
}
